fix: add timeouts to model fetchers and send router models incrementally#11748
Draft
roomote[bot] wants to merge 1 commit intomainfrom
Draft
fix: add timeouts to model fetchers and send router models incrementally#11748roomote[bot] wants to merge 1 commit intomainfrom
roomote[bot] wants to merge 1 commit intomainfrom
Conversation
Addresses #11747 where blocked DNS for provider domains (e.g. openrouter.ai, router.requesty.ai) caused all providers to hang until the DNS timeout expired, even for providers with working DNS. Changes: 1. Add 10-second timeout to axios.get() calls in openrouter.ts, requesty.ts, unbound.ts, and vercel-ai-gateway.ts fetchers. The roo.ts and litellm.ts fetchers already had timeouts. 2. Send router models incrementally in the requestRouterModels handler: each provider posts its models to the webview as soon as it resolves, rather than waiting for all providers to finish via Promise.allSettled. A final aggregated message is still sent for backward compatibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
Closes: #11747
Description
This PR attempts to address Issue #11747 where blocked DNS for provider domains (e.g. openrouter.ai, router.requesty.ai) caused all providers to hang until the DNS timeout expired, preventing even working providers from being usable.
Two changes:
Add 10-second timeout to axios.get() calls in
openrouter.ts,requesty.ts,unbound.ts, andvercel-ai-gateway.tsfetchers. Theroo.tsfetcher already had a 10-second AbortController timeout, andlitellm.tsalready had a 5-second axios timeout.Send router models incrementally in the
requestRouterModelshandler: each provider posts its models to the webview as soon as it resolves, rather than waiting for all providers to finish viaPromise.allSettled. A final aggregated message is still sent for backward compatibility.This means providers with working DNS will have their models available immediately in the UI, while providers with blocked DNS will time out after 10 seconds and fail gracefully in the background.
Feedback and guidance are welcome.
Test Procedure
Pre-Submission Checklist
Documentation Updates
No documentation updates needed. This is an internal behavior change that does not affect user-facing APIs or configuration.
Interactively review PR in Roo Code Cloud